import QtQuick 2.0
import QtQuick.Controls 2.5

Rectangle {
    height: img.height
    color: Qt.rgba(0,0,0,0)

    property alias eliminatedQuantity: eliminatedQuantity.text
    property alias uneliminatedQuantity: uneliminatedQuantity.text
    property alias missesNum: missesNum.text

    property alias eliminatedShakeAnim: eliminatedShakeAnim
    property alias uneliminatedShakeAnim: uneliminatedShakeAnim
    property alias missesNumShakeAnim: missesNumShakeAnim

    Image{
        id:img
        height: 100
        source: "qrc:/Images/border.png"
        fillMode: Image.PreserveAspectFit
    }

    Column{
        spacing: 10

        Row{
            id:eliminatedQuantityRow
            spacing: 10
            Text{
                text: "已消除:"
                font.bold: true
                font.family:"STXinwei"  // 华文新魏字体
            }


            Text{
                id:eliminatedQuantity
                text: "0"
                font.bold: true
                font.family:"STXinwei"  // 华文新魏字体
            }

            Text{
                text: "个"
                font.bold: true
                font.family:"STXinwei"  // 华文新魏字体
            }

        }

        Row{
            id:uneliminatedQuantityRow
            spacing: 10
            Text{
                text: "未消除:"
                color: "red"
                font.bold: true
                font.family:"STXinwei"  // 华文新魏字体
            }


            Text{
                id:uneliminatedQuantity
                text: "0"
                color: "red"
                font.bold: true
                font.family:"STXinwei"  // 华文新魏字体
            }

            Text{
                text: "个"
                color: "red"
                font.bold: true
                font.family:"STXinwei"  // 华文新魏字体
            }

        }

        Row{
            id:missesNumRow
            spacing: 10
            Text{
                text: "已失误:"
                color: "red"
                font.bold: true
                font.family:"STXinwei"  // 华文新魏字体
            }


            Text{
                id:missesNum
                text: "0"
                color: "red"
                font.bold: true
                font.family:"STXinwei"  // 华文新魏字体
            }

            Text{
                color: "red"
                text: "次"
                font.bold: true
                font.family:"STXinwei"  // 华文新魏字体
            }

        }


        anchors.top: parent.top
        anchors.topMargin: 20
        anchors.left: parent.left
        anchors.leftMargin: 15

    }

    SequentialAnimation{
        id:eliminatedShakeAnim    // 已消除任务球抖动动画

        PropertyAnimation{
            target: eliminatedQuantity
            property: "scale"
            to:1.5
            duration: 50
        }

        PropertyAnimation{
            target: eliminatedQuantity
            property: "scale"
            to:1.0
            duration: 300
        }

    }


    SequentialAnimation{
        id:uneliminatedShakeAnim    // 未消除任务球抖动动画
        RotationAnimation{
            target: uneliminatedQuantityRow
            to:-15;
            duration: 100
        }
        RotationAnimation{
            target: uneliminatedQuantityRow
            to: 15;
            duration: 100
        }
        RotationAnimation{
            target: uneliminatedQuantityRow
            to:0;
            duration: 100
        }
        loops: 2
    }


    SequentialAnimation{
        id:missesNumShakeAnim    // 失误抖动动画
        RotationAnimation{
            target: missesNumRow
            to:-15;
            duration: 100
        }
        RotationAnimation{
            target: missesNumRow
            to: 15;
            duration: 100
        }
        RotationAnimation{
            target: missesNumRow
            to:0;
            duration: 100
        }
        loops: 2
    }


}
